{% extends 'baykeshop/base_site.html' %}

{% load shop_tags %}

{% block title %} 
{% if cate %}{{ cate.name }}{% else %}全部文章{% endif %}
{% endblock %}

{% block breadcrumb %}
<section class="hero is-primary is-bold">
    <div class="hero-body has-text-centered">
      <p class="title">
        商城资讯
      </p>
      <p class="subtitle">
        {% if cate %}{{ cate.name }}{% else %}Shop News{% endif %}
      </p>
    </div>
</section>
{% endblock %}


{% block content %}
    <div class="container mt-3">
      <div class="columns">
        <div class="column is-9">
          <div class="box" style="height: 100%;">
            {% block article_box %}
              {% for article in page_obj %}
                <h1 class="is-size-5 has-text-weight-bold"><a class=" has-text-black-bis" href="{% url 'baykeshop:article_detail' article.id %}">{{ article.title }}</a></h1>
                <p class="is-size-7 has-text-grey">
                  分类:{{ article.category.name }}&nbsp;&nbsp;
                  浏览量:{{ article.pv }}&nbsp;&nbsp;
                  访问量:{{ article.uv }}&nbsp;&nbsp;
                  发布日期:{{ article.add_date }}
                </p>
              <div class=" dropdown-divider"></div>
              {% endfor %}
            {% endblock %}
          </div>

          {% page page_obj %}
        </div>
        <div class="column">
          <div class="box">
            <h1 class=" is-size-6 has-text-weight-bold">资讯分类</h1>
            <div class="dropdown-divider"></div>
            <aside class=" menu">
              <ul class=" menu-list">
                <li>
                  <a class="{% if '/article/' == request.path %} is-active {% endif %}" 
                     href="{% url 'baykeshop:article_list' %}">全部分类</a>
                </li>
                {% for category in cates %}
                  <li>
                    <a class="{% if cate and cate.id == category.id or article and article.category.id == category.id %} is-active {% endif %}" 
                       href="{% url 'baykeshop:article_category_list' category.id %}">{{ category.name }}</a>
                  </li>
                {% endfor %}
              </ul>
            </aside>
          </div>
          <!-- <div class="box">
            <h1 class=" is-size-6 has-text-weight-bold">资讯归档</h1>
            <div class="dropdown-divider"></div>
            <aside class=" menu">
              <ul class=" menu-list">
                {% for arch in archive %}
                  <li><a href="">{{ arch }}</a></li>
                {% endfor %}
              </ul>
            </aside>
          </div> -->
          <div class="box">
            <h1 class=" is-size-6 has-text-weight-bold">资讯标签</h1>
            <div class="dropdown-divider"></div>
            <div class="tags">
              {% for tag in tags %}
                <a href="" class="tag {{ tags_classes|random }}">{{ tag.name }}</a>
              {% endfor %}
            </div>
          </div>
        </div>
      </div>
    </div>
{% endblock %}
    

